<template>
	<view>
		<view style="padding: 32upx;">
			<order-info>
				<view class="title">上传取货图片</view>
				<van-uploader image-fit="aspectFit" multiple=true max-count="1" :file-list="pickUpImage"
								@after-read="afterRead('pickUpImage',$event)" @delete="onDelete('pickUpImage',$event)" preview-size="120upx" />
				<view class="title">合同图片</view>
				<van-uploader image-fit="aspectFit" multiple=true max-count="1" :file-list="contractImage"
								@after-read="afterRead('contractImage',$event)" @delete="onDelete('contractImage',$event)" preview-size="120upx" />
			</order-info>
		</view>
		<view style="width: 750upx;background: #FFFFFF;padding: 52upx 0upx; text-align: center;font-size: 52upx;font-weight: bold;color: #333333;">
			<label>￥320.00</label>
			<button class="button myButton" @click="submit(submutText=='确认取货'?0:(submutText=='取消订单'?1:2))" v-text="submutText"></button>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				pickUpImage:'',
				contractImage:'',
				submutText:'确认取货'
			}
		},
		methods:{
			submit(flag){
				const that=this;
				if(flag==0){
					uni.setNavigationBarTitle({
						title: "待确认"
					});
					that.submutText='取消订单';
				}else if(flag==1){
					uni.setNavigationBarTitle({
						title: "已取消"
					});
					that.submutText='去接单';
				}else{
					uni.switchTab({
						url:'/pages/index/index'
					});
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title{
		margin-top: 40upx;
		font-size: 28upx;
		font-weight: bold;
		color: #333333;
	}
	.myButton{
		margin:40upx auto;
	}
</style>
